package com.example.io.fileinputstream;

import java.io.FileInputStream;
import java.io.IOException;

/**
 * @Author 尚智江
 * @description
 * @CreateDate 2024/1/9 21:45
 */
public class ByteStreamByIn3 {
    public static void main(String[] args) throws IOException {
        /*
        public int read(byte[] buffer)  一次读一共字节组数据
         */

        FileInputStream fileInputStream = new FileInputStream("E:\\SpringBoot\\Spring-Boot\\java-io\\src\\main\\resources\\a.txt");
        // 读取数据
        byte[] bytes = new byte[2];
        int read = fileInputStream.read(bytes);
        String s = new String(bytes);
        System.out.println(s);

        fileInputStream.close();
    }
}
